#define _CRT_SECURE_NO_WARNINGS  1

#include <iostream>
#include <vector>
using namespace std;
int GetPower(int power, int compare)
{
	int t;
	while (t = compare % power)
	{
		compare = power;
		power = t;
	}
	return power;
}
int main()
{
	int num;
	int power;
	while (cin >> num >> power)
	{
		vector<int> v(num);
		for (int i = 0; i < num; i++)
		{
			cin >> v[i];
		}
		for (int i = 0; i < num; i++)
		{
			if (power > v[i] || power == v[i])
			{
				power += v[i];
			}
			else
				power += GetPower(power, v[i]);
		}
		cout << power << endl;
	}
	return 0;
}
